package com.jy.api.controller.pos;

import com.jy.api.service.NumService;
import com.jy.api.signUpReq.pos.OpenNumReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * Created by xiaohua on 2019/3/5.
 */
@Slf4j
@RestController
@RequestMapping(value = "v1/pos", produces = "application/json;charset=utf-8")
public class PartitionNumController {
    @Autowired
    private NumService numService;

    /**
     * 开台
     *
     * @param req
     * @return
     */
    @PostMapping("open-num")
    public ResponseEntity openNum(@RequestBody OpenNumReq req) {
        return ResponseEntity.ok(numService.openNum(req));
    }

    /**
     * 更新台桌状态
     * @param req
     * @return
     */
    @PostMapping("update-num")
    public ResponseEntity updateNum(@RequestBody OpenNumReq req) {
        return ResponseEntity.ok(numService.updateNum(req));
    }


}
